import React, { Component } from 'react';
import {withRouter, Switch,Route,Redirect } from "react-router-dom";
import Home from "./pages/Home.jsx";
import List from "./pages/list/List.jsx";
import Detail from "./pages/detail/Detail.jsx";

class App extends Component {
  render() {
    return <>
      <Route path="/home"  children={(props)=><Home {...props}/>}/>
      {/* 列表页 */}
      <Route path="/list/:title" children={(props)=><List {...props}/>}/>
      {/* 详情页 */}
      <Route path="/detail/:id?" children={(props)=><Detail {...props}/>}/>
      <Redirect from="/" exact to="/home" />
    </>
  }
}
export default App;

